package com.bao.work;

import java.io.*;

/**
 * @author baoye
 * @date 2024-08-05/17:11
 */
public class Work03 {
    public static void main(String[] args) throws IOException {
        BufferedWriter fos=new BufferedWriter(new FileWriter("day09\\src\\com\\bao\\work\\testIO\\data.txt"));

        int a=10;
        char c='a';
        double d=2.5;
        boolean b=true;
        String str="rdlh";
        StringBuilder sb=new StringBuilder();
        sb.append(a).append("-").append(c).append("-").append(d).append("-").append(b).append("-").append(str);
        char[] chars = sb.substring(0).toCharArray();
        for (char aChar : chars) {
            fos.write(aChar);
            fos.flush();
        }


        BufferedReader fis=new BufferedReader(new FileReader("day09\\src\\com\\bao\\work\\testIO\\data.txt"));
        String s = fis.readLine();
        String[] split = s.split("-");
        for (String s1 : split) {
            System.out.println(s1);
        }



        fis.close();
        fos.close();
    }
}
